<template>
 <Teleport to="body">
    <div class="container1">
    {{msg }}
 </div>
 </Teleport>
</template>

<script lang='ts' setup>
import {inject,ref,onMounted} from 'vue'
let msg=ref<string>("")
onMounted(()=>{
  let info=inject("aa")
  msg.value=info as string
})
</script>


<style lang='scss' scoped>
.container1{
  display: flex;
  width: 100px;
  height: 100px;
  background-color:skyblue;
  justify-content: center;
  align-items: center;
}
</style>